﻿using BoutiquePOS.DAL.DAO;
using BoutiquePOS.DAL.Gateway;

namespace BoutiquePOS.Manager
{
    public class CustomerPaymentManager
    {
        CustomerPaymentGateway aCustomerPaymentGateway = new CustomerPaymentGateway();
        public string SaveCustomerPayment(CustomerPayment customerPayment)
        {
            //if (!DoesThisCustomerPaymentExist(customerPayment))
                return aCustomerPaymentGateway.SaveCustomerPayment(customerPayment);
            //else
            //{
            //    return "This Company Already Exists";
            //}
        }

        //private bool DoesThisCustomerPaymentExist(CustomerPayment customerPayment)
        //{
        //    List<CustomerPayment> aCustomerPayments = new List<CustomerPayment>();
        //    aCustomerPayments = GetAllCustomerPayment();

        //    foreach (CustomerPayment custPaymentObj in aCustomerPayments)
        //    {
        //        if (custPaymentObj.PaidAmount == customerPayment.PaidAmount)
        //            return true;
        //    }
        //    return false;
        //}       

        public string DeleteCustomerPayment(int customerPaymentId)
        {
            string message = aCustomerPaymentGateway.DeleteCustomerPaymentBySalesId(customerPaymentId);
            return message;
        }
    }
}